package com.xinchao.job.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinchao.common.vo.WeatherVO;
import com.xinchao.job.mapper.quartz.WeatherMapper;

/**
 * @ClassName WeatherService
 * @Description 天气Service
 * @Author HanQinrui
 * @Date 2018/9/4 17:38
 * @Version 1.0
 **/
@Service("weatherService")
public class WeatherService {
    @Autowired
    private WeatherMapper weatherMapper;

    /**
     * 保存天气信息
     * @param weatherVO
     */
    public void insertWeather(WeatherVO weatherVO) {
        Long addTime = System.currentTimeMillis();
        weatherMapper.insertWeather(weatherVO, addTime);
    }

    /**
     * 终端获取天气信息
     * @param cityName 城市
     * @return
     */
    public WeatherVO getWeatherInfo(String cityName) {
        return weatherMapper.getWeatherInfo(cityName);
    }
}
